package com.fw.system.admin.service.impl;

import java.util.List;

import com.fw.common.IdXD;
import org.springframework.beans.factory.annotation.Autowired;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.fw.system.admin.mapper.TbBannerMapper;
import com.fw.system.admin.domain.TbBanner;
import com.fw.system.admin.service.ITbBannerService;
import com.fw.utils.DateUtils;

/**
 * bannerService业务层处理
 * 
 * @author xxx
 * @date 2021-12-03
 */
@Service
public class TbBannerServiceImpl extends ServiceImpl<TbBannerMapper, TbBanner> implements ITbBannerService
{
    @Autowired
    private TbBannerMapper tbBannerMapper;

    @Autowired
    private IdXD idXD;

    /**
     * 查询banner
     * 
     * @param id bannerID
     * @return banner
     */
    @Override
    public TbBanner selectTbBannerById(String id)
    {
        return tbBannerMapper.selectTbBannerById(id);
    }

    /**
     * 查询banner列表
     * 
     * @param tbBanner banner
     * @return banner
     */
    @Override
    public List<TbBanner> selectTbBannerList(TbBanner tbBanner)
    {
        return tbBannerMapper.selectTbBannerList(tbBanner);
    }

    /**
     * 新增banner
     * 
     * @param tbBanner banner
     * @return 结果
     */
    @Override
    public int insertTbBanner(TbBanner tbBanner)
    {
        tbBanner.setId(idXD.nextId());
        return tbBannerMapper.insertTbBanner(tbBanner);
    }

    /**
     * 修改banner
     * 
     * @param tbBanner banner
     * @return 结果
     */
    @Override
    public int updateTbBanner(TbBanner tbBanner)
    {
        return tbBannerMapper.updateTbBanner(tbBanner);
    }

    /**
     * 批量删除banner
     * 
     * @param ids 需要删除的bannerID
     * @return 结果
     */
    @Override
    public int deleteTbBannerByIds(String[] ids)
    {
        return tbBannerMapper.deleteTbBannerByIds(ids);
    }

    /**
     * 删除banner信息
     * 
     * @param id bannerID
     * @return 结果
     */
    @Override
    public int deleteTbBannerById(String id)
    {
        return tbBannerMapper.deleteTbBannerById(id);
    }
}
